package com.ruoyi.base.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.base.mapper.BaseSubjectMapper;
import com.ruoyi.base.domain.BaseSubject;
import com.ruoyi.base.service.IBaseSubjectService;

/**
 * 数据主题Service业务层处理
 * 
 * @author yepanpan
 * @date 2025-02-24
 */
@Service
public class BaseSubjectServiceImpl implements IBaseSubjectService 
{
    private static final Logger log = LoggerFactory.getLogger(BaseSubjectServiceImpl.class);

    @Autowired
    private BaseSubjectMapper baseSubjectMapper;

    /**
     * 查询数据主题
     * 
     * @param id 数据主题主键
     * @return 数据主题
     */
    @Override
    public BaseSubject selectBaseSubjectById(Long id)
    {
        return baseSubjectMapper.selectBaseSubjectById(id);
    }

    /**
     * 查询数据主题列表
     * 
     * @param baseSubject 数据主题
     * @return 数据主题
     */
    @Override
    public List<BaseSubject> selectBaseSubjectList(BaseSubject baseSubject)
    {
        return baseSubjectMapper.selectBaseSubjectList(baseSubject);
    }

    /**
     * 新增数据主题
     * 
     * @param baseSubject 数据主题
     * @return 结果
     */
    @Override
    public int insertBaseSubject(BaseSubject baseSubject)
    {
        baseSubject.setCreateTime(DateUtils.getNowDate());
        return baseSubjectMapper.insertBaseSubject(baseSubject);
    }

    /**
     * 修改数据主题
     * 
     * @param baseSubject 数据主题
     * @return 结果
     */
    @Override
    public int updateBaseSubject(BaseSubject baseSubject)
    {
        baseSubject.setUpdateTime(DateUtils.getNowDate());
        return baseSubjectMapper.updateBaseSubject(baseSubject);
    }

    /**
     * 批量删除数据主题
     * 
     * @param ids 需要删除的数据主题主键
     * @return 结果
     */
    @Override
    public int deleteBaseSubjectByIds(Long[] ids)
    {
        return baseSubjectMapper.deleteBaseSubjectByIds(ids);
    }

    /**
     * 删除数据主题信息
     * 
     * @param id 数据主题主键
     * @return 结果
     */
    @Override
    public int deleteBaseSubjectById(Long id)
    {
        return baseSubjectMapper.deleteBaseSubjectById(id);
    }


}
